# SETTINGS
$packageId = "Globsite.Globalization.Mvc"
$fileName = "Globsite.Globalization.Mvc.dll"
$sourceFolder = "..\Mvc\bin\NuGet-net45\"
$targetFolder = ".\lib\net45\"
$nuGetPath = "..\Solution Items\Tools\NuGet\NuGet.exe"


# Read the current assembly version.
$assemblyVersion = [Reflection.AssemblyName]::GetAssemblyName("$($targetFolder)$($fileName)").Version.ToString()

# Create the name of a NuGet package file consistent with the present assembly.
$packageFileName = ".\$($packageId).$($assemblyVersion).nupkg"

# Push package to the NuGet server.
Start-Process -NoNewWindow -Wait -FilePath $nuGetPath -ArgumentList "push $($packageFileName) -Verbosity detailed"

# Remove the pushed NuGet package file, which is not longer needed.
Remove-Item -Path $packageFileName

# Prevent for closing the window.
Write-Host "`r`n***** Press Enter to exit *****" -ForegroundColor Yellow
Read-Host